//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "tmf_camera\main.sqf"
#include <tmf_constants.h>
#include <tmf_macros.h>

TRACE("Start");
if (!isDedicated) then {
		if (IS_MARKER("camera_1")) then {
		0 spawn {
			private ["_marker","_marker_text","_camera","_cameras","_c","_missing"];
			_camera = [];
			_cameras = [];
			_c = 1;
			_missing = 0;
			while { _c < 1000 && _missing < 50 } do {
				_marker = format["tmf_cam_%1",_c];
				if (IS_MARKER(_marker)) then {
					_missing = 0;
					_camera = [_marker] call tmf_camera_fnc_parseMarker;
					_cameras set [count _cameras, _camera];
				} else {
					INC(_missing);
				};
			};
			waituntil {!isnull player};
			{
				_sleep = [_x] call tmf_camera_fnc_executeCamera;
				sleep _sleep;
			} foreach _cameras;
		};
	};
};
TRACE("End");